﻿using System.Collections.Generic;

namespace Toybox.NicoSharp.Utilities
{
	/// <summary>
	/// Serialize Utility
	/// </summary>
	public static class Serializer
	{
		/// <summary>
		/// And,Equalで構成されたクエリを作成する
		/// </summary>
		/// <param name="dict"></param>
		/// <returns></returns>
		public static string AndEqualPairSerializer(IDictionary<string, string> dict)
		{
			string result = null;
			int count = dict.Count;
			foreach (var entry in dict)
			{
				result += entry.Key + "=" + entry.Value;
				if (0 < --count)
					result += "&";
			}

			return result;
		}

	}
}
